




module Snake_Game(
	
	input			clk,
	input			VGA_CLK,
	input			rst,
	
	
	//key_control
	input			up,
	input			down,
	input			left,
	input			right,
	
	//addr
	input[8:0]		x_addr,
	input[8:0]		y_addr,

	//snake data
	output[23:0]	data
);







wire[3:0]	direction;  //curr direction






Snake_Update_Data  Snake_Update_Data_HP(
	
	.clk		(VGA_CLK),
	.rst		(rst),
	
	
	.direction	(direction),
	
	.x_addr	(x_addr),
	.y_addr	(y_addr),
	
	
	.odata	(data)
	
	
);




Direction_control Direction_control_HP(

	.clk		(clk),
	.rst		(rst),
	
	
	
	.up		(up),
	.down		(down),
	.left		(left),
	.right	(right),



	.direction	(direction)
);



endmodule 